<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ include file="../../common/base.jsp"%>
<%
	response.setCharacterEncoding("utf-8");
%>
<!DOCTYPE html><html lang="zh-cn">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Insert title here</title>
<link href="${path }/dist/css/bootstrap.css" rel="stylesheet">
<link href="${path }/dist/css/bootstrap-overrides.css" rel="stylesheet">
<title>编辑资产</title>
<!-- Button -->
<link href="${path }/dist/css/compiled/elements.css" rel="stylesheet">
<!-- libraries -->
<link rel="stylesheet" type="text/css"  href="${path }/dist/css/font-awesome.css">
<!-- this -->
<link rel="stylesheet" type="text/css" href="${path }/dist/css/app.css">

<link href='${path }/dist/css/zTreeStyle/zTreeStyle.css' rel='stylesheet' />

<link rel="stylesheet" type="text/css" href="${path }/back/ifrom.css">
<script src="${path }/dist/js/jquery.min.js"></script>
<script src='${path }/dist/js/bootstrap.min.js'></script>


<style>
input[type=text]{
	width: 50px;
	height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.428571429;
  color: #555555;
  vertical-align: middle;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
 
</style>
</head>
<bady onbeforeunload="return '当前页面还有未保存的数据，确定不保存就离开了吗？';">
<div id="pad-wrapper">
	<div class="row head">
	<div class="col-md-12">
			<h3>系统设置<em><small>在此处您可以设置系统单位名称，资产编号规则，等</small></em></h3>
			</div>
	</div>
	<hr>
	<ul class="nav nav-tabs" role="tablist" id="myTab">
  <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>
  <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">资产编号设置</a></li>
  <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
  <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>
</ul>

<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="home">1.</div>
  <div role="tabpanel" class="tab-pane" id="profile">
  	<div class="page-header">
  		<h4>编号规则<small>设置资产编号规则</small></h4>
  		<form method="post" action="${path }/back/system!editserial" id="serial_form">
	  		<p>是否自动编号<input type="radio" name='is_auto_number' checked="checked" value="1"/>y
								<input type="radio" name='is_auto_number' value="0"/>n</p>
			<input type="text" name='serial.head' value="${serialhead }" /><span>+</span>
			<input type="text" name='serial.interval' value="${serialinterval }"/><span>+</span>
			<input type="text" name='serial.no' value="${serialno}" style="width: 100px;"/><span></span>
			<div><span style="margin-right: 30px;">前缀 </span><span style="margin-right: 30px;">间隔符</span><span>流水号</span></div>
		</form>
		<div>预览</div>
		<input type="text" id="print" readonly="readonly" style="width: 150px;" value="${serialhead }${serialinterval }${serialno}"/>
		<button type="button" class="btn btn-primary" id="serial_submit">提交</button>
  	</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="messages">3.</div>
  <div role="tabpanel" class="tab-pane" id="settings">4.</div>
</div>


</div>
<script>
  $(function () {
	  $(":radio[value='${is_auto_number}']").attr('checked',true);
    //$('#myTab a:last').tab('show')
    $("#serial_form input[type='text']").change(function(){
    	$("#print").val("");
    	$("#serial_form input[type='text']").each(function(){
    		$("#print").val($("#print").val()+$(this).val());
    	});
    });
    $("#serial_submit").click(function(){
    	var  from_data=$("#serial_form").serializeArray();
		var saveURL = "${path }/back/system!editserial?date="+new Date()+"";
		jQuery.post(saveURL,from_data,function(jsonData){
			if(jsonData.info){
				alert(jsonData.text);
			 	window.location.reload();
			}else{
				alert("修改失败：原因\n"+jsonData.text);
			}
		},"json");
    });
  })
</script>
</bady>
</html>